package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.RouteStationMapper;
import com.ruoyi.system.domain.RouteStation;
import com.ruoyi.system.service.IRouteStationService;

/**
 * 基准路线对应点Service业务层处理
 *
 * @author ruoyi
 * @date 2025-10-21
 */
@Service
public class RouteStationServiceImpl implements IRouteStationService
{
    @Autowired
    private RouteStationMapper routeStationMapper;

    /**
     * 查询基准路线对应点
     *
     * @param id 基准路线对应点主键
     * @return 基准路线对应点
     */
    @Override
    public RouteStation selectRouteStationById(Long id)
    {
        return routeStationMapper.selectRouteStationById(id);
    }

    /**
     * 查询基准路线对应点列表
     *
     * @param routeStation 基准路线对应点
     * @return 基准路线对应点
     */
    @DataSource(DataSourceType.SLAVE)
    @Override
    public List<RouteStation> selectRouteStationList(RouteStation routeStation)
    {
        return routeStationMapper.selectRouteStationList(routeStation);
    }

    /**
     * 新增基准路线对应点
     *
     * @param routeStation 基准路线对应点
     * @return 结果
     */
    @Override
    public int insertRouteStation(RouteStation routeStation)
    {
        routeStation.setCreateTime(DateUtils.getNowDate());
        return routeStationMapper.insertRouteStation(routeStation);
    }

    /**
     * 修改基准路线对应点
     *
     * @param routeStation 基准路线对应点
     * @return 结果
     */
    @Override
    public int updateRouteStation(RouteStation routeStation)
    {
        routeStation.setUpdateTime(DateUtils.getNowDate());
        return routeStationMapper.updateRouteStation(routeStation);
    }

    /**
     * 批量删除基准路线对应点
     *
     * @param ids 需要删除的基准路线对应点主键
     * @return 结果
     */
    @Override
    public int deleteRouteStationByIds(Long[] ids)
    {
        return routeStationMapper.deleteRouteStationByIds(ids);
    }

    /**
     * 删除基准路线对应点信息
     *
     * @param id 基准路线对应点主键
     * @return 结果
     */
    @Override
    public int deleteRouteStationById(Long id)
    {
        return routeStationMapper.deleteRouteStationById(id);
    }
}
